import React from "react";

class ListAdd extends React.Component {
  state = {
    value: 0,
  };
  handleClick = () => {
    this.setState({ value: this.state.value + 1 });
    console.log(this.state.value);  
    this.setState({ value: this.state.value + 1 });
    console.log(this.state.value);

    setTimeout(() => {
      this.setState({ value: this.state.value + 1 });
      console.log(this.state.value);
      this.setState({ value: this.state.value + 1 });
      console.log(this.state.value);
    }, 0);
  };
  render() {
    return <div onClick={() => this.handleClick()}>ListAdd</div>;
  }
  // componentDidMount(): void {
  //   this.setState({ value: this.state.value + 1 });
  //   console.log(this.state.value);
  //   this.setState({ value: this.state.value + 1 });
  //   console.log(this.state.value);

  //   setTimeout(() => {
  //     this.setState({ value: this.state.value + 1 });
  //     console.log(this.state.value);
  //     this.setState({ value: this.state.value + 1 });
  //     console.log(this.state.value);
  //   }, 0);
  // }
}

export default ListAdd;
